package com.hzhr.iot.collect.service.helper;

import com.hzhr.iot.collect.Global;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.device.sdk.model.collectDevice_valveStatus.CollectDevice_ValveStatusPutModel;
import com.hzhr.iot.device.sdk.service.Device_CollectDevice_ValveStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;

@Component
public class Device_CollectDevice_ValveStatusServiceHelper {
    @Autowired
    Device_CollectDevice_ValveStatusService device_collectDevice_valveStatusService;
    @Autowired
    Global global;

    public void putByCollectDeviceId(Integer collectDeviceId, String valveStatus) throws ServiceException {
        CollectDevice_ValveStatusPutModel body = new CollectDevice_ValveStatusPutModel();
        body.setCurrentValveStatusCode(valveStatus);
        device_collectDevice_valveStatusService.putByCollectDeviceId(global.initGlobalHeader(), collectDeviceId, new HashMap<>(), body);
    }

}
